


clear all 
use the_dataset.dta

keep if  standard == 1

keep culture_d unemp case_2 culture1 educ_basic1-educ_sup1 age051-age661 income1 NMIEMB1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1
global covariates culture1 educ_basic1-educ_sup1 age051-age661 income1 NMIEMB1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1
preserve
drop if case_2 != 1

* use seed 1, 2, or 3 for different iterations
set seed 1

* Gen placebo treatments
forvalues i=1(1)2000{

gen ind_culture`i' = _n 
gen aux`i' = rnormal(0,1) 
sort aux`i'
gen placebo`i' = 1 in 1/529
replace placebo`i' = 0 if placebo`i'!=1 
sort ind_culture`i' 
drop ind_culture`i' aux`i'
}
/**/

gen est1 = 0 
gen se1 = 0

* estimate placebo effects
forvalues i=1(1)521{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
absdid culture_d if case_2==1, tvar(placebo522) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_522 = e(b)
scalar scest_522 = maest_522[1,1]

matrix mase_522 = e(V)
scalar scse_522 = sqrt(mase_522[1,1])

replace est1 = scest_522 in 522
replace se1  = scse_522 in 522

drop  placebo522 
save placebo_did_2_1.dta, replace
/**/

forvalues i=523(1)555{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/


/**/
absdid culture_d if case_2==1, tvar(placebo556) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_556 = e(b)
scalar scest_556 = maest_556[1,1]

matrix mase_556 = e(V)
scalar scse_556 = sqrt(mase_556[1,1])

replace est1 = scest_556 in 556
replace se1  = scse_556 in 556

drop  placebo556 
save placebo_did_2_1.dta, replace
/**/
forvalues i=557(1)681{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/

/**/
absdid culture_d if case_2==1, tvar(placebo682) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_682 = e(b)
scalar scest_682 = maest_682[1,1]

matrix mase_682 = e(V)
scalar scse_682 = sqrt(mase_682[1,1])

replace est1 = scest_682 in 682
replace se1  = scse_682 in 682

drop  placebo682 
save placebo_did_2_1.dta, replace
/**/
forvalues i=683(1)686{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/

/**/
absdid culture_d if case_2==1, tvar(placebo687) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_687 = e(b)
scalar scest_687 = maest_687[1,1]

matrix mase_687 = e(V)
scalar scse_687 = sqrt(mase_687[1,1])

replace est1 = scest_687 in 687
replace se1  = scse_687 in 687

drop  placebo687 
save placebo_did_2_1.dta, replace
/**/
forvalues i=688(1)757{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/
/**/
absdid culture_d if case_2==1, tvar(placebo758) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_758 = e(b)
scalar scest_758 = maest_758[1,1]

matrix mase_758 = e(V)
scalar scse_758 = sqrt(mase_758[1,1])

replace est1 = scest_758 in 758
replace se1  = scse_758 in 758

drop  placebo758 
save placebo_did_2_1.dta, replace
/**/
absdid culture_d if case_2==1, tvar(placebo759) xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_759 = e(b)
scalar scest_759 = maest_759[1,1]

matrix mase_759 = e(V)
scalar scse_759 = sqrt(mase_759[1,1])

replace est1 = scest_759 in 759
replace se1  = scse_759 in 759

drop  placebo759 
save placebo_did_2_1.dta, replace
/**/
/**/
absdid culture_d if case_2==1, tvar(placebo760) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_760 = e(b)
scalar scest_760 = maest_760[1,1]

matrix mase_760 = e(V)
scalar scse_760 = sqrt(mase_760[1,1])

replace est1 = scest_760 in 760
replace se1  = scse_760 in 760

drop  placebo760 
save placebo_did_2_1.dta, replace
/**/
forvalues i=761(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/

/**/
absdid culture_d if case_2==1, tvar(placebo809) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_809 = e(b)
scalar scest_809 = maest_809[1,1]

matrix mase_809 = e(V)
scalar scse_809 = sqrt(mase_809[1,1])

replace est1 = scest_809 in 809
replace se1  = scse_809 in 809

drop  placebo809 
save placebo_did_2_1.dta, replace
/**/
forvalues i=810(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}

/**/
absdid culture_d if case_2==1, tvar(placebo896) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_896 = e(b)
scalar scest_896 = maest_896[1,1]

matrix mase_896 = e(V)
scalar scse_896 = sqrt(mase_896[1,1])

replace est1 = scest_896 in 896
replace se1  = scse_896 in 896

drop  placebo896 
save placebo_did_2_1.dta, replace
/**/
forvalues i=897(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
/**/
absdid culture_d if case_2==1, tvar(placebo939) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_939 = e(b)
scalar scest_939 = maest_939[1,1]

matrix mase_939 = e(V)
scalar scse_939 = sqrt(mase_939[1,1])

replace est1 = scest_939 in 939
replace se1  = scse_939 in 939

drop  placebo939 
save placebo_did_2_1.dta, replace
/**/
forvalues i=940(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
/**/
absdid culture_d if case_2==1, tvar(placebo1169) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1169 = e(b)
scalar scest_1169 = maest_1169[1,1]

matrix mase_1169 = e(V)
scalar scse_1169 = sqrt(mase_1169[1,1])

replace est1 = scest_1169 in 1169
replace se1  = scse_1169 in 1169

drop  placebo1169 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1170(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
absdid culture_d if case_2==1, tvar(placebo1314) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1314 = e(b)
scalar scest_1314 = maest_1314[1,1]

matrix mase_1314 = e(V)
scalar scse_1314 = sqrt(mase_1314[1,1])

replace est1 = scest_1314 in 1314
replace se1  = scse_1314 in 1314

drop  placebo1314 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1315(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
absdid culture_d if case_2==1, tvar(placebo1377) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1377 = e(b)
scalar scest_1377 = maest_1377[1,1]

matrix mase_1377 = e(V)
scalar scse_1377 = sqrt(mase_1377[1,1])

replace est1 = scest_1377 in 1377
replace se1  = scse_1377 in 1377

drop  placebo1377 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1378(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar(culture1 NMIEMB1 educ_basic1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
absdid culture_d if case_2==1, tvar(placebo1446) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1446 = e(b)
scalar scest_1446 = maest_1446[1,1]

matrix mase_1446 = e(V)
scalar scse_1446 = sqrt(mase_1446[1,1])

replace est1 = scest_1446 in 1446
replace se1  = scse_1446 in 1446

drop  placebo1446 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1447(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
/**/
absdid culture_d if case_2==1, tvar(placebo1539) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1539 = e(b)
scalar scest_1539 = maest_1539[1,1]

matrix mase_1539 = e(V)
scalar scse_1539 = sqrt(mase_1539[1,1])

replace est1 = scest_1539 in 1539
replace se1  = scse_1539 in 1539

drop  placebo1539 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1540(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
/**/
absdid culture_d if case_2==1, tvar(placebo1780) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1780 = e(b)
scalar scest_1780 = maest_1780[1,1]

matrix mase_1780 = e(V)
scalar scse_1780 = sqrt(mase_1780[1,1])

replace est1 = scest_1780 in 1780
replace se1  = scse_1780 in 1780

drop  placebo1780 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1781(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
*

absdid culture_d if case_2==1, tvar(placebo1916) xvar(culture1 NMIEMB1 educ_med1-educ_sup1 age051-age661 income1 ccaadummy1-ccaadummy17 yeardummy1-yeardummy9 size_dummy1-size_dummy5  number_spanish1) sle 
matrix maest_1916 = e(b)
scalar scest_1916 = maest_1916[1,1]

matrix mase_1916 = e(V)
scalar scse_1916 = sqrt(mase_1916[1,1])

replace est1 = scest_1916 in 1916
replace se1  = scse_1916 in 1916

drop  placebo1916 
save placebo_did_2_1.dta, replace
/**/
forvalues i=1917(1)2000{

absdid culture_d if case_2==1, tvar(placebo`i') xvar($covariates) sle 
matrix maest_`i' = e(b)
scalar scest_`i' = maest_`i'[1,1]

matrix mase_`i' = e(V)
scalar scse_`i' = sqrt(mase_`i'[1,1])

replace est1 = scest_`i' in `i'
replace se1  = scse_`i' in `i'

drop  placebo`i' 
save placebo_did_2_1.dta, replace
}
*
scalar drop _all

* comoute the share of false positives
gen t_estat_1 = est1/se1

gen false_pos_10_1 = 1 if t_estat_1<= -1.64 | t_estat_1>=1.64
replace false_pos_10_1 = 0 if t_estat_1> -1.64 & t_estat_1<1.64

gen false_pos_5_1 = 1 if t_estat_1<= -1.96 | t_estat_1>=1.96
replace false_pos_5_1 = 0 if t_estat_1> -1.96 & t_estat_1<1.96


sum false_pos_5_1 false_pos_10_1 if cont<2001

save placebo_did_2_1.dta, replace


